<?php
namespace  Api\Controller;
use       Think\Controller;
class CronController extends Controller{
	public function website_testing(){
		//echo get_website_code("www.baidu.com");
		$website=M("website")->limit(0,100)->select();
		foreach ($website as  $value) {
			$domain=explode("\n",$value['domain']);
			//print_r($domain);
			$code=get_website_code($domain[0]);
			//echo $code;
			$data=array(
				'ctime'=>time(),
				'website_id'=>$value['id'],
				'code'=>$code['http_code'],
				'total_time'=>$code['total_time']
				
			);
			M("WebsiteTesting")->add($data);
		}
	}
	
	
}
?>